package com.pe1n.yangtaopai.customClass;

import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.graphics.drawable.ClipDrawable;
import android.graphics.drawable.ColorDrawable;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.PopupWindow;
import android.widget.TableRow;
import android.widget.Toast;

import com.pe1n.yangtaopai.R;
import com.pe1n.yangtaopai.view.activity.InjectionActivity;

/**
 * Created by My on 2016/11/22.
 */

public class SelectPicPopupWindow extends PopupWindow {
    //自定义popupwindow
    private LinearLayout mlinearLayout;
    private View mMenuView;
    private Context mcontext;
    private SharedPreferences sharedPreferences;
    public SelectPicPopupWindow(Context context,SharedPreferences sharedPreferences) {
        super(context);
        this.mcontext=context;
        this.sharedPreferences=sharedPreferences;
        LayoutInflater inflater= (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        mMenuView=inflater.inflate(R.layout.myfragment_register,null,false);
        mlinearLayout= (LinearLayout) mMenuView.findViewById(R.id.activity_register_linearLayout);
        mlinearLayout.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent=new Intent( mcontext, InjectionActivity.class);
                mcontext.startActivity(intent);
                dismiss();
            }
        });
        this.setContentView(mMenuView);
        this.setHeight(ViewGroup.LayoutParams.WRAP_CONTENT);
        this.setWidth(ViewGroup.LayoutParams.MATCH_PARENT);
        this.setFocusable(true);
        this.setAnimationStyle(R.style.Animation_pop);
        ColorDrawable cd=new ColorDrawable(0xb0000000);
        this.setBackgroundDrawable(cd);
    }
}
